﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class salary_grantController : Controller
    {
        private readonly Isalary_grant he;

        public salary_grantController(Isalary_grant he)
        {
            this.he = he;
        }
        public IActionResult salary_grant()
        {
            return View();
        }
        public IActionResult salary_grantInsert(int? id)
        {
            ViewBag.third_kind_id = id;
            return View();
        }
        //人力资源未发工资查询
        public async Task<IActionResult> FenY(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.FenY(currentPage,pageSize)));
        }
        //按三级机构查人力资源
        public async Task<IActionResult> FenYTo(human_file _File)
        {
            return Content(JsonConvert.SerializeObject(await he.FenYTo(_File)));
        }
        //按三级机构查人力资源未发工资
        public async Task<IActionResult> FenYTos(human_file _File)
        {
            return Content(JsonConvert.SerializeObject(await he.FenYTos(_File)));
        }
        //按薪酬编号查薪酬详细信息
        public async Task<string> Que(string id)
        {
            return await he.Que(id);
        }
        //人力资源状态修改(已发工资)
        public async Task<int> Upset(human_file id)
        {
            return await he.Upset(id);
        }
        //薪酬发放添加
        public async Task<int> Insert(salary_grant salary_)
        {
            return await he.Insert(salary_);
        }
        //薪酬发放详细添加
        public async Task<int> InsertTo(salary_grant_details salary_)
        {
            return await he.InsertTo(salary_);
        }
    }
}
